package _543cloud_new;

import java.util.ArrayList;
import java.util.Iterator;

public class Match_Multi {
	
	String left;
	ArrayList<String> right = new ArrayList<>();
	
	public Match_Multi(){
		
	}

	public Match_Multi(String l, String r){
		this.left = l;
		if(!right.contains(r))
			this.right.add(r);
	}
	
	public void addup(String l, String r){
		this.left = l;
		if(!right.contains(r))
			this.right.add(r);
	}
	
	
	public String toString(){
		StringBuffer sb = new StringBuffer();
		sb.append("[");
		Iterator<String> temp_i = right.iterator();
		while(temp_i.hasNext()){
			String str = temp_i.next();
			sb.append(str);
			if(temp_i.hasNext()) sb.append(", ");
		}
		sb.append("]");
		return left+"->"+sb.toString();
	}
	
}
